package com.train.batch.req;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddJobReq {

    @NotBlank(message = "任务名称不能为空")
    private String jobName;

    @NotBlank(message = "任务组名不能为空")
    private String groupName;

    @NotBlank(message = "cron表达式不能为空")
    private String cronExpress;

    private String jobParam;

    @NotNull(message = "重试次数不能为空")
    @Pattern(regexp = "^[0-9]+$", message = "重试次数必须为有效数字")
    private int retryCount;

    @NotNull(message = "重试间隔不能为空")
    @Pattern(regexp = "^[0-9]+$", message = "重试间隔必须为有效数字")
    private int retryInterval;
}
